home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
(A)TB
/
(A)TBE.ADF
/
Utility
/
LS_source
/
ls.h
next >
Wrap
C/C++ Source or Header
|
1990-08-26
|
4KB
|
141 lines
/*
* ls.h - header file for a UNIX-like directory utility
*
* ls v4.0k is (c) Copyright 1990, Kim E. DeVaughn, all rights reserved.
*
*/
/* Prevent Lint from complaining about ANSI prototype extensions */
#ifdef _lint
#define __asm
#define __stdargs
#define __regargs
#define R_D0
#define R_D1
#define R_A0
#else
#define R_D0 register __d0
#define R_D1 register __d1
#define R_A0 register __a0
#endif
/* Use Real strlen unless you comment out the following */
#define strlen strlen
#include <dos.h>
#include <libraries/dosextens.h>
/*lint -save */
/*lint -library */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include <proto/exec.h>
#include <proto/dos.h>
/*lint -restore */
extern int tolower (char);
#define MEMF_PUBLIC (1L << 0)
#define MEMF_CHIP (1L << 1)
#define MEMF_FAST (1L << 2)
#define MEMF_CLEAR (1L << 16)
#define SUPPRESS_ERR_REQ (void *)-1L
/* usage defines ... error codes eventually reported to the OS as DOS #120's */
#define SYNTAX 0L
#define ILLEGAL_ARG 120000L
#define MISSING_ARG 120010L
#define PATTERN_ERR 120020L
#define WILDSPEC_ERR 120030L
/* Structure used to hold file info in a linked list */
struct FibEntry
{
struct MinNode fe_Node;
struct FileInfoBlock *fe_Fib;
};
typedef struct FileInfoBlock FIB;
typedef struct FileLock FLK;
typedef struct InfoData ID;
#define MAX_BLKS_PER_EXTENT 72
/* Maximum number of command line args, buffer sizes, etc. */
#define MAXARG 32
#define MAXDEPTH 0x7fffffff
#define MAXFNLEN 30
#define PADTABSIZE 100
#define WORKSIZE 300
/* Flag bits for LSFlags and LSFlagsX */
#define BREAKFLAG (1L << 0)
#define CONSOLE (1L << 1)
#define SHOWDIRS (1L << 2)
#define SHOWFILES (1L << 3)
#define LISTALL (1L << 4)
#define LONGLIST (1L << 5)
#define NOSORTFLAG (1L << 6)
#define NOTEFLAG (1L << 7)
#define PATHNAMED (1L << 8)
#define REVFLAG (1L << 9)
#define WILDPATH (1L << 10)
#define FULLPATHNAMES (1L << 11)
#define ANTIMATCH (1L << 12)
#define TOTALIZE (1L << 13)
#define NOHEADERS (1L << 14)
#define NOINTERACT (1L << 15)
#define FILESFIRST (1L << 16)
#define SEPFILESDIRS (1L << 17)
#define SHOWOLDERTHAN (1L << 18)
#define SHOWNEWERTHAN (1L << 19)
#define IGNORECASELIST (1L << 20)
#define IGNORECASEWILD (1L << 21)
#define MATCHDOTFILES (1L << 22)
#define MATCHINFOFILES (1L << 23)
#define SHOWHIDDEN (1L << 24)
#define OLDLONGFORMAT (1L << 25)
#define VARCOLSFORMAT (1L << 26)
#define ONECOLFORMAT (1L << 27)
#define ADDDIRSLASH (1L << 28)
#define SHOWDISKKEYS (1L << 29)
#define RELPATHNAMES (1L << 30)
#define NODIRTOTAL (1L << 31)
#define WILDPATHFLAG (1L << 32 - 32)
#define SINGLEFILEFLAG (1L << 33 - 32)
#define DATABLKSONLY (1L << 34 - 32)
#define NOWILDPATHDIRS (1L << 35 - 32)
#define EMPTYDIRFLAG (1L << 36 - 32)
#define NOTFOUNDHALT (1L << 37 - 32)
#define NOFIXNUMBLOCKS (1L << 38 - 32)
/* defines for datestr() */
#define TIME_YEAR_THRESHOLD 180 /* days for AGE_TO_YEARS format */
/* change -----v d = space or D */
#define AGE_TO_YEARS 0 /* MMM dD HH:MM or MMM dD YYYY */
#define FULL_FORM 1 /* MMM DD YYYY HH:MM:SS */
#define DASHA_FORM 2 /* DD-MMM-YY HH:MM:SS */
#define DASHN_FORM 3 /* MM-DD-YY HH:MM:SS */
#define SLASH_FORM 4 /* MM/DD/YY HH:MM:SS */
#define EURO_FORM 5 /* DD/MM/YY HH:MM:SS */
#define DOT_FORM 6 /* YY.MM.DD HH:MM:SS */
/* defines for attrstr() */
#define FIBB_HIDDEN 7 /* not in 1.3 includes, but works with Protect */
#define FIBF_HIDDEN (1 << FIBB_HIDDEN)
#define FIBF_RESERVED ~(FIBF_HIDDEN | FIBF_SCRIPT | FIBF_PURE | \
FIBF_ARCHIVE | FIBF_READ | FIBF_WRITE | \
FIBF_EXECUTE | FIBF_DELETE)